package com.security.demo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/")
@PreAuthorize("hasRole('ADMIN')")
public class TestController {
	
	@RequestMapping(value = "/test", method = RequestMethod.GET)
	public ModelAndView test() {
		return new ModelAndView("index");
	}
	
}